<!DOCTYPE html>
<!--
Copyright 2013 The Polymer Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
-->
<html>
<head>
  <meta name="viewport" content="initial-scale=1.0">
  <title>using lib::class on Node types</title>
  <script src="../../lib/oop.js"></script>
  <script src="../../Platform/CustomElements/custom-elements.js"></script>
</head>
<body>
  <button is="x-button"></button>
  <script>
    XButton = $class(HTMLButtonElement, {
      constructor: function() {
        this.emit('[Construct Base]')
        this.textContent = "XButton";
      },
      emit: function(inMsg) {
        document.body.appendChild(document.createTextNode(inMsg));
      },
      soundOff: function() {
        this.emit('[Base]');
      } 
    });
    XButton = document.register('x-button', {
      extends: 'button',
      prototype: XButton.prototype,
      lifecycle: {
        readyCallback: XButton.prototype.constructor
      }
    });
    document.body.appendChild(new XButton()).textContent = 'Hello World';
  </script>
</body>
</html>
